3.104 \(\int x \sin (a+\frac{b}{x}) \, dx\)

Optimal. Leaf size=60 \[ \frac{1}{2} b^2 \sin (a) \text{CosIntegral}\left (\frac{b}{x}\right )+\frac{1}{2} b^2 \cos (a) \text{Si}\left (\frac{b}{x}\right )+\frac{1}{2} x^2 \sin \left (a+\frac{b}{x}\right )+\frac{1}{2} b x \cos \left (a+\frac{b}{x}\right ) \]

[Out]

(b*x*Cos[a + b/x])/2 + (b^2*CosIntegral[b/x]*Sin[a])/2 + (x^2*Sin[a + b/x])/2 + (b^2*Cos[a]*SinIntegral[b/x])/
2

________________________________________________________________________________________

Rubi [A]  time = 0.0976248, antiderivative size = 60, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {3379, 3297, 3303, 3299, 3302} \[ \frac{1}{2} b^2 \sin (a) \text{CosIntegral}\left (\frac{b}{x}\right )+\frac{1}{2} b^2 \cos (a) \text{Si}\left (\frac{b}{x}\right )+\frac{1}{2} x^2 \sin \left (a+\frac{b}{x}\right )+\frac{1}{2} b x \cos \left (a+\frac{b}{x}\right ) \]

Antiderivative was successfully verified.

[In]

Int[x*Sin[a + b/x],x]

[Out]

(b*x*Cos[a + b/x])/2 + (b^2*CosIntegral[b/x]*Sin[a])/2 + (x^2*Sin[a + b/x])/2 + (b^2*Cos[a]*SinIntegral[b/x])/
2

Rule 3379

Int[(x_)^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Sin[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IntegerQ[Simpl
ify[(m + 1)/n]] && (EqQ[p, 1] || EqQ[m, n - 1] || (IntegerQ[p] && GtQ[Simplify[(m + 1)/n], 0]))

Rule 3297

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[((c + d*x)^(m + 1)*Sin[e + f*x])/(d*(
m + 1)), x] - Dist[f/(d*(m + 1)), Int[(c + d*x)^(m + 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && LtQ[
m, -1]

Rule 3303

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Dist[Cos[(d*e - c*f)/d], Int[Sin[(c*f)/d + f*x]
/(c + d*x), x], x] + Dist[Sin[(d*e - c*f)/d], Int[Cos[(c*f)/d + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f},
x] && NeQ[d*e - c*f, 0]

Rule 3299

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[SinIntegral[e + f*x]/d, x] /; FreeQ[{c, d,
 e, f}, x] && EqQ[d*e - c*f, 0]

Rule 3302

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rubi steps

\begin{align*} \int x \sin \left (a+\frac{b}{x}\right ) \, dx &=-\operatorname{Subst}\left (\int \frac{\sin (a+b x)}{x^3} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{2} x^2 \sin \left (a+\frac{b}{x}\right )-\frac{1}{2} b \operatorname{Subst}\left (\int \frac{\cos (a+b x)}{x^2} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{2} b x \cos \left (a+\frac{b}{x}\right )+\frac{1}{2} x^2 \sin \left (a+\frac{b}{x}\right )+\frac{1}{2} b^2 \operatorname{Subst}\left (\int \frac{\sin (a+b x)}{x} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{2} b x \cos \left (a+\frac{b}{x}\right )+\frac{1}{2} x^2 \sin \left (a+\frac{b}{x}\right )+\frac{1}{2} \left (b^2 \cos (a)\right ) \operatorname{Subst}\left (\int \frac{\sin (b x)}{x} \, dx,x,\frac{1}{x}\right )+\frac{1}{2} \left (b^2 \sin (a)\right ) \operatorname{Subst}\left (\int \frac{\cos (b x)}{x} \, dx,x,\frac{1}{x}\right )\\ &=\frac{1}{2} b x \cos \left (a+\frac{b}{x}\right )+\frac{1}{2} b^2 \text{Ci}\left (\frac{b}{x}\right ) \sin (a)+\frac{1}{2} x^2 \sin \left (a+\frac{b}{x}\right )+\frac{1}{2} b^2 \cos (a) \text{Si}\left (\frac{b}{x}\right )\\ \end{align*}

Mathematica [A]  time = 0.0517267, size = 52, normalized size = 0.87 \[ \frac{1}{2} \left (b^2 \sin (a) \text{CosIntegral}\left (\frac{b}{x}\right )+b^2 \cos (a) \text{Si}\left (\frac{b}{x}\right )+x \left (x \sin \left (a+\frac{b}{x}\right )+b \cos \left (a+\frac{b}{x}\right )\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x*Sin[a + b/x],x]

[Out]

(b^2*CosIntegral[b/x]*Sin[a] + x*(b*Cos[a + b/x] + x*Sin[a + b/x]) + b^2*Cos[a]*SinIntegral[b/x])/2

________________________________________________________________________________________

Maple [A]  time = 0.01, size = 57, normalized size = 1. \begin{align*} -{b}^{2} \left ( -{\frac{{x}^{2}}{2\,{b}^{2}}\sin \left ( a+{\frac{b}{x}} \right ) }-{\frac{x}{2\,b}\cos \left ( a+{\frac{b}{x}} \right ) }-{\frac{\cos \left ( a \right ) }{2}{\it Si} \left ({\frac{b}{x}} \right ) }-{\frac{\sin \left ( a \right ) }{2}{\it Ci} \left ({\frac{b}{x}} \right ) } \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*sin(a+b/x),x)

[Out]

-b^2*(-1/2*sin(a+b/x)*x^2/b^2-1/2*cos(a+b/x)*x/b-1/2*cos(a)*Si(b/x)-1/2*Ci(b/x)*sin(a))

________________________________________________________________________________________

Maxima [C]  time = 1.1412, size = 103, normalized size = 1.72 \begin{align*} \frac{1}{4} \,{\left ({\left (-i \,{\rm Ei}\left (\frac{i \, b}{x}\right ) + i \,{\rm Ei}\left (-\frac{i \, b}{x}\right )\right )} \cos \left (a\right ) +{\left ({\rm Ei}\left (\frac{i \, b}{x}\right ) +{\rm Ei}\left (-\frac{i \, b}{x}\right )\right )} \sin \left (a\right )\right )} b^{2} + \frac{1}{2} \, b x \cos \left (\frac{a x + b}{x}\right ) + \frac{1}{2} \, x^{2} \sin \left (\frac{a x + b}{x}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(a+b/x),x, algorithm="maxima")

[Out]

1/4*((-I*Ei(I*b/x) + I*Ei(-I*b/x))*cos(a) + (Ei(I*b/x) + Ei(-I*b/x))*sin(a))*b^2 + 1/2*b*x*cos((a*x + b)/x) +
1/2*x^2*sin((a*x + b)/x)

________________________________________________________________________________________

Fricas [A]  time = 2.00243, size = 203, normalized size = 3.38 \begin{align*} \frac{1}{2} \, b^{2} \cos \left (a\right ) \operatorname{Si}\left (\frac{b}{x}\right ) + \frac{1}{2} \, b x \cos \left (\frac{a x + b}{x}\right ) + \frac{1}{2} \, x^{2} \sin \left (\frac{a x + b}{x}\right ) + \frac{1}{4} \,{\left (b^{2} \operatorname{Ci}\left (\frac{b}{x}\right ) + b^{2} \operatorname{Ci}\left (-\frac{b}{x}\right )\right )} \sin \left (a\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(a+b/x),x, algorithm="fricas")

[Out]

1/2*b^2*cos(a)*sin_integral(b/x) + 1/2*b*x*cos((a*x + b)/x) + 1/2*x^2*sin((a*x + b)/x) + 1/4*(b^2*cos_integral
(b/x) + b^2*cos_integral(-b/x))*sin(a)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \sin{\left (a + \frac{b}{x} \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(a+b/x),x)

[Out]

Integral(x*sin(a + b/x), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int x \sin \left (a + \frac{b}{x}\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*sin(a+b/x),x, algorithm="giac")

[Out]

integrate(x*sin(a + b/x), x)